package com.wust.supermarket.service.impl;

import com.wust.supermarket.dao.MemberDao;
import com.wust.supermarket.domain.Member;
import com.wust.supermarket.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberDao memberDao;

    @Override
    public List<Member> listAllMembers() {
        // TODO Auto-generated method stub
        return memberDao.listAllMembers();
    }

    @Override
    public Member getMemberById(int memberId) {
        // TODO Auto-generated method stub
        return memberDao.getMemberById(memberId);
    }

    @Override
    public int insertMember(Member member) {
        // TODO Auto-generated method stub
        return memberDao.insertMember(member);
    }

    @Override
    public int updateMember(Member member) {
        // TODO Auto-generated method stub
        return memberDao.updateMember(member);
    }

    @Override
    public int deleteMember(int memberId) {
        // TODO Auto-generated method stub
        return memberDao.deleteMember(memberId);
    }

    @Override
    public int getMemberNumber() {
        return memberDao.getMemberNumber();
    }
}
